(function($) {
  'use strict';

  $(function() {
	  
		$("#signOut1").click(function() {
			logout();
		});
		$("#signOut2").click(function() {
			logout();
		});

		function logout() {

			//window.location.href="/login.html";
			$.ajax({
				type : "POST",
				url : "/login/logout",
				datatype : "json",//"xml", "html", "script", "json", "jsonp", "text".

				//成功返回之后调用的函数            
				success : function(data) {
					var code = data.code;
					if (code == 1) {
						window.location.href = "/login.html";
					} else {
						window.location.href = "/login.html";
					}
				},
				//调用出错执行的函数
				error : function() {
					//请求出错处理
					window.location.href = "/login.html";
				}
			});
		}
    
  });
  
})(jQuery);